var e = getApp();

Page({
    data: {
        kefu: "http://www.120kg.xyz/static/images/wxMovie/id-card.jpeg",
        videoAd: e.globalData.config.adConfig.videoAd,
        list: [],
        userInfo: {},
        hasUserInfo: !1,
        canIUse: wx.canIUse("button.open-type.getUserInfo"),
        catalogList: [ {
            key: 1,
            text: "免责声明",
            url: "/pages/disclaimer/index",
            src: "../../images/wendang.png"
        }, {
            key: 2,
            text: "观看更多",
            url: "/pages/searchDetail/index",
            src: "../../images/col.png"
        } ]
    },
    bannerNav: function() {
        wx.previewImage({
            current: this.data.kefu,
            urls: [ this.data.kefu ]
        });
    },
    goIndex: function() {
        wx.switchTab({
            url: "/pages/index/index"
        });
    },
    onLoad: function(t) {
        var a = this;
        e.globalData.userInfo ? a.setUserInfo(e.globalData.userInfo) : a.data.canIUse ? e.userInfoReadyCallback = function(e) {
            a.setUserInfo(e.userInfo);
        } : wx.getUserInfo({
            success: function(e) {
                a.setUserInfo(e.userInfo);
            }
        });
    },
    onShow: function() {
        var e = this, t = wx.getStorageSync("_collect"), a = Object.keys(t).join(",");
        t && wx.request({
            url: "https://www.120kg.xyz/getCollect",
            data: {
                ids: a
            },
            method: "POST",
            success: function(t) {
                var a = t.data.data;
                e.setData({
                    list: a
                });
            }
        });
    },
    getUserInfo: function(e) {
        this.setUserInfo(e.detail.userInfo);
    },
    setUserInfo: function(t) {
        null != t && (e.globalData.userInfo = t, this.setData({
            userInfo: t,
            hasUserInfo: !0
        }));
    }
});